package com.xja.mapper;

import com.xja.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.xja.pojo.BlogUsers;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface ArticleMapper {

    void addArticle(Article article);

    List<Article> getHotestArticle();

    List<BlogUsers> getHotestUser();

    List<Article> selectInitCheckArticle(Integer adminId);

    List<Article> selectCheckArticle();

    Article selectArticleByAid(Integer aid);

    void addArticleCheckMessage(ArticleCheckMessage message);

    void updateArticleStatus(ArticleCheckMessage message);

    List<ArticleCheckMessage> selectMessageByAid(Integer aid);

    void updateArticlePermit(@Param("aid") Integer aid, @Param("astatus")String astatus);

    List<Article> selectArticleByUid(@Param("uid")Integer uid, @Param("count")Integer count,@Param("astatus")Integer astatus);

    @Select("select count(aid) from article where bloguid=#{uid}")
    Integer selectArticleCount(Integer uid);

    @Select("select count(userid) from article_coll_info where userid=#{uid}")
    Integer selectCollArtNum(Integer uid);

    Article getarticleById(Integer aid);

    List<ArticleComment> getComment(@Param("aid") Integer aid, @Param("count") Integer count);

    List<Article> getLikeArticles(@Param("typeid") Integer typeid,@Param("aid") Integer aid);

    List<ArticleComment> getdateArticlesList(@Param("aid") Integer aid,@Param("count") Integer count);

    void addreadtime(Integer aid);

    int addCommentKid(ArticleComment articleComment);

    int addComment(ArticleComment articleComment);

    void updatecomment(ArticleComment articleComment);

    List<Article> getArticleList(Article article);

    ArticleCheckMessage getArticleMessage(Integer aid);

    void updateArticle(Article article);

    int coll(ArticleCollInfo articleCollInfo);

    ArticleCollInfo getCollInfo(@Param("uid") Integer uid, @Param("aid") Integer aid);

    void unColl(ArticleCollInfo articleCollInfo);

}